package com.leonardo.beanme.fields.impl;

import javax.microedition.lcdui.ChoiceGroup;

import com.leonardo.beanme.fields.abs.ChoiceBox;
import com.leonardo.beanme.model.ComboBox;

public class ComboInput extends ChoiceBox {

	public ComboInput() throws Exception{
		super(ChoiceGroup.POPUP);
	}

	public void setValue(Object obj) {
		if(lock)	return;
		if(!(obj instanceof ComboBox))
			throw new IllegalArgumentException();
		ComboBox comboBox = (ComboBox) obj;
		getGroup().setSelectedIndex(comboBox.getSelectedIndex(), true);
	}

}
